<?php session_start(); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ประกันภัยรถยนต์</title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" />
<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>
<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
<script type="text/javascript" src="Scripts/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="Scripts/stepcarousel.js"></script>
</head>

<body>
<table width="918" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="421"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="10"><img src="images/bg-hd1.jpg" width="10" height="421"></td>
        <td bgcolor="#FFFFFF"><object id="FlashID2" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1117" height="432">
          <param name="movie" value="flash/header.swf">
          <param name="quality" value="high">
          <param name="wmode" value="transparent">
          <param name="swfversion" value="6.0.65.0">
          <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
          <param name="expressinstall" value="Scripts/expressInstall.swf">
          <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
          <!--[if !IE]>-->
          <object type="application/x-shockwave-flash" data="flash/header.swf" width="1117" height="432">
            <!--<![endif]-->
            <param name="quality" value="high">
            <param name="wmode" value="transparent">
            <param name="swfversion" value="6.0.65.0">
            <param name="expressinstall" value="Scripts/expressInstall.swf">
            <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
            <div>
              <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
              <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
            </div>
            <!--[if !IE]>-->
          </object>
          <!--<![endif]-->
        </object></td>
        <td width="9" align="right"><img src="images/bg-hd2.jpg" width="9" height="421"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="9" valign="top" background="images/bgl2.jpg"><img src="images/bgl.jpg" width="9" height="338" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td background="images/bg-menu.jpg">
            <?php include "top_menu.php"; ?>
            </td>
          </tr>
          <tr>
            <td height="3" bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="3" /></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="9"><img src="images/pblog08.jpg" width="9" height="43" alt="" /></td>
                <td align="center" background="images/pblog09.jpg"><object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="874" height="39">
                  <param name="movie" value="flash/banner1.swf">
                  <param name="quality" value="high">
                  <param name="wmode" value="transparent">
                  <param name="swfversion" value="6.0.65.0">
                  <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                  <param name="expressinstall" value="Scripts/expressInstall.swf">
                  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                  <!--[if !IE]>-->
                  <object type="application/x-shockwave-flash" data="flash/banner1.swf" width="874" height="39">
                    <!--<![endif]-->
                    <param name="quality" value="high">
                    <param name="wmode" value="transparent">
                    <param name="swfversion" value="6.0.65.0">
                    <param name="expressinstall" value="Scripts/expressInstall.swf">
                    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                    <div>
                      <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                      <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                    </div>
                    <!--[if !IE]>-->
                  </object>
                  <!--<![endif]-->
                </object></td>
                <td width="9"><img src="images/pblog10.jpg" width="9" height="43" alt="" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td><?php include 'gallery.php'; ?></td>
                    <td width="20">&nbsp;</td>
                    <td width="18" align="left"><a href="javascript:stepcarousel.stepBy('mygallery', 3)"><img src="images/banner-next.jpg" title="Next &gt;&gt;"  border="0" /></a></td>
                    <td width="15" align="left">&nbsp;</td>
                  </tr>
                </table></td>
                <td width="8" bgcolor="#FFFFFF">&nbsp;</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="10"><img src="images/spacer.gif" width="1" height="10" /></td>
              </tr>
              <tr>
                <td height="14"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="20">&nbsp;</td>
                    <td background="images/pblog11.jpg"><img src="images/welcome.jpg" width="284" height="37" alt="" /></td>
                    <td width="10">&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td height="14"><img src="images/spacer.gif" width="1" height="14" /></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="8" bgcolor="#FFFFFF">&nbsp;</td>
                    <td width="270" valign="top" bgcolor="#212121">
                    <!--side-->
                    <?php include "side.php"; ?>
                      <!--  Side-->
                        </td>
                    <td width="18"><img src="images/spacer.gif" width="18" height="1" /></td>
                    <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="5"><img src="images/pblog01.jpg" width="5" height="42" /></td>
                                  <td background="images/pblog13.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                      <td width="15">&nbsp;</td>
                                      <td><h2>ประกันชั้น3ไม่มี พรบ.</h2></td>
                                    </tr>
                                  </table></td>
                                  <td width="4"><img src="images/pblog12.jpg" width="4" height="42" alt="" /></td>
                                </tr>
                              </table></td>
                            </tr>
                            <tr>
                              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td width="12" background="images/pblog23.jpg"><img src="images/pblog23.jpg" width="12" height="2" alt="" /></td>
                                  <td bgcolor="#E2E2E2" class="links">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="center"><a href="insure3.php?type=2"><img src="images/car1.jpg" width="152" height="70" border="0"></a></td>
                  <td align="center">&nbsp;</td>
                  <td align="center"><a href="insure3.php?type=6"><img src="images/car2.jpg" width="152" height="70" border="0"></a></td>
                  <td align="center">&nbsp;</td>
                  <td align="center"><a href="insure3.php?type=4"><img src="images/car3.jpg" width="152" height="70" border="0"></a></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td align="center"><strong class="text2">
              	<?
					if($_GET['type']==2 or $_GET['type']=='')
					{
						echo 'รถเก๋งบุคคล';	
					}
					if($_GET['type']==6)
					{
						echo 'รถกะบะบุคคล';	
					}
					if($_GET['type']==4)
					{
						echo 'รถตู้บุคคล';	
					}
				?></strong>
              </td>
            </tr>
            <tr>
              <td>
                
                <div id="list">
                 <?php

if($_GET['order']=='asc'){$order="desc";}else{$order="asc";} 
if($_GET['company']=='asc'){$orderc="desc";}else{ $orderc="asc";}
if($_GET['budget']=='asc'){$orderb="desc";}else{$orderb="asc";}
?>
<table width="100%" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" >
                    <tr>
                      <td rowspan="2" bgcolor="#75ACFF"><div align="center" class="list">บริษัท</div>
                        <div align="center" class="list"><a href="?company=<?=$orderc;?>&type=<?=$_GET['type']?>" style="text-decoration:underline;"><img src="images/<?=$orderc?>.png" alt="" width="30" height="30" border="0" /></a></div></td>
                      <td colspan="2" bgcolor="#8CBAFF"><div align="center" class="list">รับผิดชอบบุคคลภายนอก</div></td>
                      <td colspan="3" bgcolor="#A6CAFF"><div align="center" class="list">ตัวรถเอาประกันภัย</div></td>
                      <td colspan="3" bgcolor="#B3D1FF"><div align="center" class="list">ภัยพิเศษ</div></td>
                      <td rowspan="2" bgcolor="#BBD7FF"><div align="center" class="list">ราคาปกติ</div>
                        <div align="center" class="list"><a href="?order=<?=$order;?>&type=<?=$_GET['type']?>" style="text-decoration:underline;"><img src="images/<?=$order?>.png" border="0" width="30" height="30" /></a></div></td>
                      <td rowspan="2" bgcolor="#CCE0FF"><div align="center" class="list">ซื้อสด</div></td>
                      <td rowspan="2" bgcolor="#D9E8FF"><div align="center" class="list">ผ่อน 2 งวด<br>
                        (ต่องวด)</div></td>
                    </tr>
                    <tr>
                      <td bgcolor="#A6CAFF"><div align="center" class="list">ทรัพย์สิน</div></td>
                      <td bgcolor="#A6CAFF"><div align="center" class="list">บุคคล</div></td>
                      <td bgcolor="#B3D1FF"><div align="center" class="list">สูญหาย/<br />
                        ไฟไหม้</div></td>
                      <td bgcolor="#B3D1FF"><div align="center" class="list">การชน</div>
                        <div align="center" class="list"><a href="?budget=<?=$orderb;?>&type=<?=$_GET['type']?>" style="text-decoration:underline;"><img src="images/<?=$orderb?>.png" border="0" width="30" height="30" /></a></div></td>
                      <td bgcolor="#B3D1FF"><div align="center" class="list">น้ำท่วม</div></td>
                      <td bgcolor="#BBD7FF"><div align="center" class="list">อุบัติเหตุ<br />
                        ส่วนบุคคล</div></td>
                      <td bgcolor="#BBD7FF"><div align="center" class="list">ค่ารักษา<br />
                        พยาบาล</div></td>
                      <td bgcolor="#BBD7FF"><div align="center" class="list">ประกันตัว<br />
                        ผู้ขับขี่</div></td>
                      </tr>
                    <?php
						if($_GET['type'])
						{
							$sql = "select * from tb_insure where insure_type = '".$_GET['type']."' ";
						}
						else
						{
							$sql = "select * from tb_insure where insure_type = 2  ";	
						}
						switch($_GET['order']){
						
							case"asc";
								$sql.=" order by j desc";
							break;
							case"desc";
								$sql.=" order by j asc";
							break;
						}
						switch($_GET['company']){
						
							case"asc";
								$sql.=" order by b asc";
							break;
							case"desc";
								$sql.=" order by b desc";
							break;
						}
						
						switch($_GET['budget']){
						
							case"asc";
								$sql.=" order by h desc";
							break;
							case"desc";
								$sql.=" order by h asc";
							break;
						}
						$qr = select($sql);
						$total = count($qr);
						$i=0;
						while($i<$total)
						{
							if($bg=='#ffffff')
							{
								$bg = '#D9E8FF';	
							}
							else
							{
								$bg = '#ffffff';	
							}
							$rs = $qr[$i];
							$i++;
					?>
                            <tr bgcolor="<?=$bg;?>">
                              <td bgcolor=""><div align="center" class="list"><?=$rs['b']?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['t'])?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['r'])?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=$rs['i']?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=$rs['h']?></div></td>
                              <td bgcolor=""><div align="center" class="list">
                                <?=number_format($rs['z'])?>
                              </div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['u'])?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['v'])?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['w'])?></div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['j'],2)?><br />
                              </div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['j']-$rs['j']*(0.075),2)?><a href="buy.php?id=<?=$rs['id']?>&insure=1"><br />
                                <img src="images/buy.gif" border="0" /></a><br />
                              </div></td>
                              <td bgcolor=""><div align="center" class="list"><?=number_format($rs['j']/2,2)?><a href="buy.php?id=<?=$rs['id']?>&insure=2"><br />
                                <img src="images/buy.gif" border="0" /></a><br />
                              </div></td>
                            </tr>
                            <?php
								if($i%15 == 0)
								{
							?>
                            	<tr>
                                  <td rowspan="2" bgcolor="#75ACFF"><div align="center" class="list">บริษัท</div></td>
                                  <td colspan="2" bgcolor="#8CBAFF"><div align="center" class="list">รับผิดชอบบุคคลภายนอก</div></td>
                                  <td colspan="3" bgcolor="#A6CAFF"><div align="center" class="list">ตัวรถเอาประกันภัย</div></td>
                                  <td colspan="3" bgcolor="#B3D1FF"><div align="center" class="list">ภัยพิเศษ</div></td>
                                  <td rowspan="2" bgcolor="#BBD7FF"><div align="center" class="list">ราคาปกติ</div></td>
                                  <td rowspan="2" bgcolor="#CCE0FF"><div align="center" class="list">ซื้อสด</div></td>
                                  <td rowspan="2" bgcolor="#D9E8FF"><div align="center" class="list">ผ่อน 2 งวด<br>
(ต่องวด)</div></td>
                                </tr>
                                <tr>
                                  <td bgcolor="#A6CAFF"><div align="center" class="list">ทรัพย์สิน</div></td>
                                  <td bgcolor="#A6CAFF"><div align="center" class="list">บุคคล</div></td>
                                  <td bgcolor="#B3D1FF"><div align="center" class="list">สูญหาย/<br />
                                    ไฟไหม้</div></td>
                                  <td bgcolor="#B3D1FF"><div align="center" class="list">การชน</div></td>
                                  <td bgcolor="#B3D1FF"><div align="center" class="list">น้ำท่วม</div></td>
                                  <td bgcolor="#BBD7FF"><div align="center" class="list">อุบัติเหตุ<br />
                                    ส่วนบุคคล</div></td>
                                  <td bgcolor="#BBD7FF"><div align="center" class="list">ค่ารักษา<br />
                                    พยาบาล</div></td>
                                  <td bgcolor="#BBD7FF"><div align="center" class="list">ประกันตัว<br />
                                    ผู้ขับขี่</div></td>
                                  </tr>
                            <?php	
									
								}
							?>
                    <?php
							
                        }
					?>
                  </table>
                </div></td>
            </tr>
          </table></td>
                                  <td background="images/pblog24.jpg"><img src="images/pblog24.jpg" width="12" height="2" alt="" /></td>
                                </tr>
                                <tr>
                                  <td><img src="images/pblog02.jpg" width="12" height="17" alt="" /></td>
                                  <td background="images/pblog03.jpg">&nbsp;</td>
                                  <td width="12"><img src="images/pblog04.jpg" width="12" height="17" alt="" /></td>
                                </tr>
                              </table></td>
                            </tr>
                          </table></td>
                        </tr>
                        <tr>
                          <td>&nbsp;</td>
                        </tr>
                        </table></td>
                    <td width="8" bgcolor="#FFFFFF">&nbsp;</td>
                    </tr>
                  </table></td>
              </tr>
              </table></td>
          </tr>
        </table></td>
        <td width="9" valign="top" background="images/bgr2.jpg"><img src="images/bgr.jpg" width="9" height="338" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="18"><img src="images/pblog05.jpg" width="18" height="19" alt="" /></td>
        <td background="images/pblog06.jpg">&nbsp;</td>
        <td width="18"><img src="images/pblog07.jpg" width="18" height="19" alt="" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center" class="menu2"><?php include "bot_menu.php"; ?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td align="center"><marquee scrollamount=2 onMouseOver="this.stop()" onMouseOut="this.start()" width="918" ><table align="center" border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr>
          <td><?php include 'marquee.php'; ?></td>
        </tr>
      </tbody>
    </table></marquee></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<script type="text/javascript">
swfobject.registerObject("FlashID");
swfobject.registerObject("FlashID2");
</script>
</body>
</html>
